#ifndef	_MCUINIT_H_
#define	_MCUINIT_H_

#include "main.h"

#define	PORT_0		0
#define	PORT_1		1
#define	PORT_2		2
#define	PORT_3		3

#define	PIN_0		0x01
#define	PIN_1		0x02
#define	PIN_2		0x04
#define	PIN_3		0x08
#define	PIN_45		0x30
#define	PIN_67		0xc0

#define	FALLING_EDGE_TRIG		0
#define	RISING_EDGE_TRIG		1
#define	LOW_LEVEL_TRIG		2
#define	HIGH_LEVEL_TRIG		3

#define UART0_Timer1	  0
#define UART0_Timer3	  1
#define UART1_Timer3	  2

#define	Timer3_DIV1			0
#define	Timer3_DIV2			1
#define	Timer3_DIV4			2
#define	Timer3_DIV8			3
#define	Timer3_DIV16		4
#define	Timer3_DIV32		5
#define	Timer3_DIV64		6
#define	Timer3_DIV128		7

#define	Timer3_EnableInterrupt	0x02
#define	Timer3_Start			0x04

#define	Uart0_EnableInterrupt	0x10
#define	Uart1_EnableInterrupt	0x01

#define	Global_Interrupts		0x80

#define 	Timer0_TH0_Init_200us		0xf3
#define 	Timer0_TL0_Init_200us		0x7f
#define 	Timer0_TH0_Init_400us		0xe6
#define 	Timer0_TL0_Init_400us		0xff

u8 Timer0_Init(u16 Cycle);
u8 Timer3_Init(u16 Cycle);
u8 Uart_Open(u8 u8UartPort,u32 u32Baudrate);
void Gpio_Init(void);
void ADC_Init(void);
#endif
